package masterSpringMvc.search;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.MatrixVariable;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import masterSpringMvc.service.SearchService;

@Controller
public class SearchController {
	@Autowired
	private SearchService searchServie;
	
	@RequestMapping("/search/{searchType}")
	public ModelAndView search(@PathVariable String searchType,@MatrixVariable List<String> keywords) {
		ModelAndView modelAndView = new ModelAndView("resultsPage");
		modelAndView.addObject("tweets");
		modelAndView.addObject("search",String.join(",", keywords));
		return modelAndView;
	}
}
